package cn.edu.cqvie.jdk8.stream2;

public class LambdaTest {

    Runnable r1 = () -> System.out.println(this);

    // Runnable 接口的一个实例（匿名内部类）
    Runnable r2 = new Runnable() {
        @Override
        public void run() {
            System.out.println(this);
        }
    };

    public static void main(String[] args) {
        LambdaTest lambdaTest = new LambdaTest();

        System.out.println("this " + lambdaTest);

        Thread t1 = new Thread(lambdaTest.r1);
        t1.start();

        System.out.println("--------");

        Thread t2 = new Thread(lambdaTest.r2);
        t2.start();
    }
}
